<!-- Copyright 2017 Capital One Services, LLC and Bitwise, Inc.
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
 http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License. -->
 
<!doctype html>
<html>
<head>
	<title>Generate Records Properties</title>
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
</head>
<body> 

<p><span class="header-1">Generate Records Properties</span></p>

<p><span><b>Properties</b>&nbsp;for the Generate Records component can be viewed by Double click-&gt;component on canvas. The properties contains the &#39;General&#39; tab and the Schema tab. It falls under the Input category in the component palette.</span></p>

<p><a name="general_properties"></a><span><b>General Properties:</b></span></p>

<p><img alt="" src="../../images/Generate_Records_Properties_General.png" /></p>

<p><span><b>Display</b></span></span></p>

<ul>
	<li><span><b>Name</b> - The identifier for the component. This is a mandatory property. This property is pre-populated with the component name, i.e. 'GRecords' followed by an incremental number. It can be changed to any custom name. The name property has following restrictions:</span></li>
	<ul>
		<li><span>Must be specified and should not be blank.</span></li>
		<li><span>Must be unique across the job.</span></li>
		<li><span>Accepts only alphabets (a-z), numerals (0-9) and 4 special characters: "_", "-", ",", " " (space)<./span></li>
	</ul>
	<li><span><b>ID</b> - ID field will specify unique id for every component. </span></li>
	<li><span><b>Type </b> - Type defines the type of component within the category. This typically is the name of the component. This is a non editable field.</span></li>
</ul>

<p><span><b>Configuration</b></span></p>

<ul>
    <li><span><b>No of Records</b> -&nbsp;No of Records field accepts an integer value. This text box accepts only numeric values. The number specified in the No of Records field is the number of records that will get generated by the component with dummy values.</span></li>
	<li><span><b>Runtime Properties</b> -&nbsp;Runtime properties are used to override the Hadoop configurations specific to Generate Records component at run time. User is required to enter the Property Name and Value in the runtime properties grid.</span></li>
	<p><span>Check <a href="../../How To Steps/How_To_Pass_Hadoop_Properties_To_Component.html"> How to pass Hadoop properties to component</a></span></p></li>
	<p><img alt="" src="../../images/Runtime_Properties_Grid.png" /></p>
	<li><span><b>Batch</b> - Batch simply accepts a numeric value starting from 0 to maximum 99 and signifies the batch this component will execute in. By default this is 0.</span></li>
</ul>
<p><span><b>Schema tab: </b></span></p>
<p><img alt="" src="../../images/Generate_Records_Properties_Schema.png" /></p>
<p><span><b>Schema Types</b></span></p>
<ul>
	<li><span><b>Internal</b> - User is provided a Grid to enter the internal schema of the Output Delimited file.</span></li>
	<ul><li><span><b>Field Name</b> - User needs to enter all the Field names in this column</span></li>
	<li><span><b>Data type</b> - By default "string" Data type has been selected for any field added to the Grid. User can select from different Data type values like "integer", "double", "float" etc.</span></li>
	<li><span><b>Date Format</b> - The format for date data type. Refer to <a href="../../references/Date_formats.html">Date formats</a> page for acceptable date formats.</span></li>
	<li><span><b>Precision</b> - Precision for a bigdecimal field can be specified here.</span></li>
	<li><span><b>Scale</b> - Scale for a double, float or bigdecimal field can be specified here.</span></li>
	<li><span><b>Scale Type</b> - Scale Type accepts values as implicit or explicit for bigdecimal field and none for other data types. Explicit considers the length of ' <b>.</b> ' and implicit ignores length of ' <b>.</b> ' for the bigdecimal field.</span></li>
	<li><span><b>Field Description</b> - User can specify field description.</span></li>
	<li><span><b>Length</b> - Length denotes the maximum number of characters that a particular Output field may contain.</span></li>
	<li><span><b>Range From - Range To</b> - User can generate the records in the specified range.</span></li>
	<li><span><b>Default Value</b> - User can specify the default value for the specified field.</span></li></ul>
	<li><span><b>External</b> - User can provide an external Hydrograph Schema file of XML format. A text box is provided to either manually type or use the Browse button to select the schema file from File system. The External schema file path is resolved during run time and replaced with the contents of the file in the Job XML.</span></li>
</ul>	
<ul>
</ul>

<p><a name="validations"></a><span class="header-2">Validations</span></p>
<p><span>The generate records component applies validations to the mandatory fields as described above. Upon placing the generate records component on job canvas for the first time (from component palette), the component shows up a warning icon as mandatory properties are not provided.</span></p>
<img src="../../images/Generate_Records_Validation_Warning.png" alt="Warning icon displayed on component" />

<p><span>The properties window also displays error icon on mandatory fields if it has an incorrect value. The error icon is displayed on the tab as well, if any of the field within the tab has some error.</span></p>
<img src="../../images/Generate_Records_Properties_Validation.png" alt="Error icon displayed on tabs" />

<p><span>If the properties window has some error even after user visit's it once, then the warning icon on the aggregate component on the job canvas changes to error icon. This error icon is removed only when all the mandatory fields are supplied with correct values.</span></p>
<img src="../../images/Generate_Records_Validation_Error.png" alt="Error icon displayed on component" />


</body>
</html>